package cn.javablog.service.impl;

import cn.javablog.Vo.PageVo;
import cn.javablog.entity.TUser;
import cn.javablog.mapper.TUserMapper;
import cn.javablog.service.TUserService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author AllenYe
 * @since 2020-09-14
 */
@AllArgsConstructor
@Transactional
@Service
public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements TUserService {
    private final TUserMapper tUserMapper;
//    @Override
//    public IPage<TUser> selectAll(PageVo pageVo) {
////        Page page = new Page(pageVo.getPageCurrent() == 0 ? 1 : pageVo.getPageCurrent(),pageVo.getPageSize() == 0 ? 10 : pageVo.getPageSize());
//////        QueryWrapper<TUser> tUser = new QueryWrapper<>();
////        tUser.like("userName",pageVo.getName()).or().orderByAsc("create_time");
////        tUser.eq("type",true);
////        pageVo.setPageCurrent(pageVo.getPageCurrent() == 0 ? 1 : pageVo.getPageCurrent());
////        pageVo.setPageSize(pageVo.getPageSize() == 0 ? 10 : pageVo.getPageSize());
////        List<TUser> tUsers = tUserMapper.selectList(pageVo.getPageCurrent(), pageVo.getPageSize(), pageVo.getName());
////        return (IPage<TUser>) tUsers;
//    }
}
